#ifndef REACTIVE_IF_THEN_ELSE_SCHEDULER_H
#define REACTIVE_IF_THEN_ELSE_SCHEDULER_H

#include "abstract_scheduler.h"
#include "global.h"

namespace scheduler
{
/**
 * @brief:  响应式的if then else，每次任务循环都会执行一遍响应式任务，根据每次响应式任务的结果，选择性执行其他任务
 * @author: sherlock_lht
 */
class ReactiveIfThenElseScheduler: public AbstractScheduler
{
public:
    explicit ReactiveIfThenElseScheduler(const std::string &name);
    ~ReactiveIfThenElseScheduler() override;

    /**
     * @brief:  设置条件判断
     * @author: sherlock_lht
     */
    bool setWhileConditionTask(const task::AbstractTaskConstPtr &task);
    bool setWhileConditionScheduler(const AbstractSchedulerConstPtr &scheduler);

    /**
     * @brief:  设置then task/scheduler
     * @author: sherlock_lht
     */
    bool setThenTask(const task::AbstractTaskConstPtr &task);
    bool setThenScheduler(const AbstractSchedulerConstPtr &scheduler);

    /**
     * @brief:  设置else task/scheduler
     * @author: sherlock_lht
     */
    bool setElseTask(const task::AbstractTaskConstPtr &task);
    bool setElseScheduler(const AbstractSchedulerConstPtr &scheduler);

    [[deprecated("reactive if then else scheduler cannot append task")]] bool appendTask(const task::AbstractTaskConstPtr &task) override;

    [[deprecated("reactive if then else scheduler cannot append scheduler")]] bool appendScheduler(const AbstractSchedulerConstPtr &scheduler) override;

    [[deprecated("reactive if then else scheduler cannot set task")]] bool setTask(const task::AbstractTaskConstPtr &task) override;

    [[deprecated("reactive if then else scheduler cannot set task")]] bool setScheduler(const AbstractSchedulerConstPtr &scheduler) override;
};

}


#endif //REACTIVE_IF_THEN_ELSE_SCHEDULER_H
